<?php
namespace catchAdmin\stock\request;

use catchAdmin\stock\model\WarehouseConfig;
use catcher\base\CatchRequest;

class WarehouseConfigCreateRequest extends CatchRequest
{

    protected function rules(): array
    {
        // TODO: Implement rules() method.
        return [
//            'name|库位名称' => 'require|unique:'.WarehouseConfig::class,
            'name' => 'require|unique:db_warehouse_config,name^tenant_id^parent_id',
            'usage'=>'in:1,2,3'
        ];
    }

    protected function message()
    {
        // TODO: Implement message() method.
        return [
            'usage.in'        => '库位功能错误范围[1，2，3]',
            'name.unique'     => '库位名称已存在',
            'name.require'     => '库位名称必须填写',
        ];
    }
}